package com.yuntian.controller;

import com.yuntian.entity.AppUser;
import com.yuntian.service.AppUserService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author yuntian
 */

@RestController
@RequestMapping("/appUser")
@RequiredArgsConstructor
public class AppUserController {

    private final AppUserService appUserService;

    @RequestMapping("/get")
    public List<AppUser> getAppUser() {
        return appUserService.getAppUser();
    }

     @RequestMapping("/save")
    public String saveAppUser(AppUser appUser) {
        appUserService.saveAppUser(appUser);
        return "saveAppUser";
    }

     @RequestMapping("/update")
    public String updateAppUser(AppUser appUser) {
        appUserService.updateAppUser(appUser);
        return "updateAppUser";
    }

     @RequestMapping("/delete")
    public String deleteAppUser(Integer userId) {
        appUserService.deleteAppUser(userId);
        return "deleteAppUser";
    }

}
